<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>一隅立画</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="./css/bannerdetail.css"/>
		<link rel="stylesheet" type="text/css" href="./css/basestyle.css"/>
		<link rel="stylesheet" type="text/css" href="./viewer/dist/viewer.min.css"/>
		<script src="js/head.js" type="text/javascript"></script>
		<script src="js/xshead.js" type="text/javascript"></script>
		<script src="js/base.js"></script>
	</head>
	<body style="background-color: #f2f3f5;">
		<div class="content">
			<div class="container">
				<div class="row">
					<div id="Official" class="col-lg-8 col-md-8 warp">
						<!-- 标题 -->
						<div ref="tippopup" style="display: none;">
							<div class="nowraceimg">
								<div class="nowraceimgnav">
									<img id="Img" @click="getimg" :src="detailinfo.image" >
								</div>
							</div>
							<div class="nowrace">
								<p v-show="languagestatus == 1">{{detailinfo.title}}</p>
								<p v-show="languagestatus == 2">{{detailinfo.titleE}}</p>
							</div>
							<div class="nowracewarp">
								<div v-show="languagestatus == 1" v-html="detailinfo.admincontent"></div>
								<div v-show="languagestatus == 2" v-html="detailinfo.adminEcontent"></div>
							</div>
						</div>
					</div>
					<!-- 左边栏 -->
					<div id="raceside" class="col-lg-4 col-md-4">
						<script src="js/racesidebar.js" type="text/javascript"></script>
					</div>
				</div>
			</div>
		</div>
		<script src="js/pcFooter.js" type="text/javascript"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
		<script src="viewer/dist/viewer.min.js"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script type="text/javascript">
			let Official = new Vue({
				el:'#Official',
				data:{
					Id:'',
					languagestatus:'',
					detailinfo:[],
					adstype:''
				},
				created:function() {
					if (sessionStorage.getItem('languagestatus')) {
						let languagestatus = sessionStorage.getItem('languagestatus')
						this.languagestatus = languagestatus
					}
				},
				mounted:function() {
					let that = this
					var theRequest = new Object()
					var url = location.search
					if (url.indexOf("?") != -1) {
						var str = url.substr(1); //substr()方法返回从参数值开始到结束的字符串；  
						var strs = str.split("&");
						for (var i = 0; i < strs.length; i++) {
							theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
						}
						// console.log( theRequest ); //此时的theRequest就是我们需要的参数；  
						that.Id = theRequest.id
						that.adstype = theRequest.adstype
					}
					this.getOfficialinfo()
					this.$refs.tippopup.style.display = 'block'
				},
				methods:{
					getOfficialinfo:function(){
						let that = this
						if(that.adstype == 1){
							axios.get('http://admin.yiyulihua.com/api/sheji.index/sidedetail',{
								params:{
									id:that.Id
								}
							})
							.then((res) =>{
								if(res.data.code == 1){
									that.detailinfo = res.data.data
								}
								console.log(res)
							})
						}else{
							axios.get('http://admin.yiyulihua.com/api/sheji.index/homedetail',{
								params:{
									id:that.Id
								}
							})
							.then((res) =>{
								if(res.data.code == 1){
									that.detailinfo = res.data.data
								}
							})
						}
					},
					getimg(){
						let viewer = new Viewer(document.getElementById('Img'), {
							// 配置\
							
						})
					},
				}
			})
		</script>
	</body>
</html>
